﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace PSE.Updater.Client.UI
{
    /// <summary>
    /// Interaction logic for ProgramarHorarios.xaml
    /// </summary>
    public partial class Schedule : Window
    {
        public bool IsClosed { get; private set; }

        public int GetHours { get; private set; }
        public int GetMinutes { get; private set; }
        public bool GetInstallOnWinStart { get; private set; }

        public Schedule()
        {
            InitializeComponent();
        }

        private void Confirm_Click(object sender, RoutedEventArgs e)
        {
            int hours = 0;
            int minutes = 0;

            int.TryParse(Hours.Text, out hours);
            int.TryParse(Minutes.Text, out minutes);

            this.GetHours = hours;
            this.GetMinutes = minutes;
            
            this.GetInstallOnWinStart = InstallOnWinStart.IsChecked.GetValueOrDefault();

            this.Close();
        } 

        private void Cancel_Click(object sender, RoutedEventArgs e)
        {
            this.IsClosed = true;
            this.Close();
        }

        private void InstallOnWinStart_Checked(object sender, RoutedEventArgs e)
        {
            Hours.IsEnabled = !InstallOnWinStart.IsChecked.GetValueOrDefault();
            Minutes.IsEnabled = !InstallOnWinStart.IsChecked.GetValueOrDefault();
        }
    }
}
